﻿using ImageResizer.Outputs.Destination;
using ImageResizer.Profiles;
using ImageResizer.Properties;

namespace ImageResizer.Outputs
{
    /// <summary>
    /// Factory des output
    /// </summary>
    internal static class OutputFactory
    {
        /// <summary>
        /// Créé une sortie
        /// </summary>
        /// <param name="profile">le profil</param>
        /// <param name="type">le type de sortie</param>
        /// <param name="path">le chemin de destination</param>
        /// <param name="connection">les informations de connection</param>
        /// <returns>une instance de Output</returns>
        public static Output Create(Profile profile, OutputType type, string path, Connection connection)
        {
            if (type == OutputType.Local)
                return new Output(profile, new LocalOutputDestination(path));
            else
                return new Output(profile, new FTPOutputDesintation(path, connection));
        }
    }
}